package cn.leyaber.hrm.service.impl;

import cn.leyaber.hrm.domain.Recharge;
import cn.leyaber.hrm.mapper.RechargeMapper;
import cn.leyaber.hrm.redusutils.constants.CommentConstant;
import cn.leyaber.hrm.service.IRechargeService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author ma.rui.kai
 * @since 2020-12-11
 */
@Service
public class RechargeServiceImpl extends ServiceImpl<RechargeMapper, Recharge> implements IRechargeService {
   @Autowired
   private RechargeMapper rechargeMapper;
    //修改状态
    @Override
    public void Modify_statusd(Recharge recharge) {
        if (recharge.getState().equals(CommentConstant.COMMENT_DISABLE)){
            recharge.setState(CommentConstant.COMMENT_ENABLE);
            rechargeMapper.updateById(recharge);
        }else{
            recharge.setState(CommentConstant.COMMENT_ENABLE);
            rechargeMapper.updateById(recharge);
        }
    }
}
